import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Test
 * Date: 2024-10-12
 * Time: 21:28
 */
public class Test {
    public static void main1(String[] args) {
        int[] array = {1,5,3,65,89,17,25};
        System.out.println(Arrays.toString(array));
        Sort.quickSort(array);
        System.out.println(Arrays.toString(array));
    }

    public static void main(String[] args) {
        hanoi(3, 'A', 'B', 'C');
    }

    public static void hanoi(int n, char pos1, char pos2, char pos3){
        if(n == 1){
            move(pos1, pos3);
        }else {
            hanoi(n - 1, pos1, pos3, pos2);//N-1从A移到B
            move(pos1, pos3);//N从A移到C
            hanoi(n - 1, pos2, pos1, pos3);//N-1从B移到C
        }
    }

    private static void move(char pos1, char pos2) {
        System.out.print(pos1 + "->" + pos2);
        System.out.println();
    }
}
